Angular X-ray cross-correlation analysis applied to the scattering data in 3D reciprocal space from a single crystal

The application of angular X-ray cross-correlation analysis to the scattered intensity distribution measured in 3D reciprocal space from a single-crystalline sample is proposed. This method provides a complementary view on the structure of the sample as well as defects present in this sample.


Introduction
The first approaches to study the structure of materials by means of angular correlations in the scattered intensities go back to the late 70s to early 80s (Kam, 1977(Kam, , 1980Clark et al., 1983). It was proposed by Kam (1977) to reveal the structure of macromolecules by analyzing the angular correlations in the scattering patterns from randomly oriented molecules in solution. In other research, correlations of scattered laser intensities from colloidal glass were found to be related to its local structure (Clark et al., 1983). At that time, the method did not undergo further development due to the lack of suitable instrumentation (Kam et al., 1981). Recently, however, it has become of great interest after the work of Wochner et al. (2009), where angular X-ray cross-correlation analysis (AXCCA) was applied to study the structure of colloidal glasses by means of X-ray scattering. The renewed interest to AXCCA was triggered by the development of modern X-ray sources such as third-and fourth-generation synchrotrons (Schroer, 2019) and novel X-ray free-electron lasers (XFELs) (Emma et al., 2010;Ishikawa et al., 2012;Kang et al., 2017;Decking et al., 2020) that provide an X-ray beam with outstanding characteristics including high brilliance, ultimate coherence and femtosecond pulse durations. These characteristics allow the measure of fluctuations in the scattering patterns containing information about the local structure that could be revealed by AXCCA. The emergence of suitable equipment has led, among practical applications, to the development of the underlying theory (Saldin et al., 2010(Saldin et al., , 2011Altarelli et al., 2010;Kirian, 2012;Kurta et al., 2016;Martin, 2017).
The practical applications of AXCCA are defined by the investigated sample and geometry of a typical X-ray scattering experiment. In such experiments, the scattered intensities are measured by a 2D detector that represents a cut of reciprocal space by the Ewald sphere. AXCCA applied to such 2D patterns reveals symmetries of the sample in the plane orthogonal to the incident beam. This is particularly suitable in studies of (quasi-)2D samples such as 2D nanostructures (Kurta et al., 2013(Kurta et al., , 2012Pedrini et al., 2013), thin polymer films Lehmkü hler et al., 2018;Schulz et al., 2020) and liquid crystals Zaluzhnyy, Kurta, Sulyanova et al., 2017). In some cases, it is possible to refine the unit-cell parameters of 3D superlattices of nanocrystals (Zaluzhnyy, Kurta, André et al., 2017;Mukharamova et al., 2019;Lokteva et al., 2019;Maier et al., 2020).
To explore the symmetries of a 3D sample, one typically collects many 2D patterns from randomly oriented identical samples, for example, injected bioparticles (Kurta et al., 2017;Pande et al., 2018) or nanocrystals (Mendez et al., 2016;Niozu et al., 2020;Ayyer et al., 2021) as shown in Fig. 1(a). To achieve reasonable scattered intensities from a small single sample, extremely high flux of the incident X-ray beam is required that can be provided by modern XFELs. The diffraction patterns collected in such an experiment represent random cuts of reciprocal space as shown in Fig. 1(b) that can be assembled into the intensity distribution in 3D reciprocal space. The main assumption of this approach is the reproducibility of the measured samples. If the measured samples are different, the revealed structure is averaged over many realizations.
At modern third-generation synchrotron sources, we can exploit their high coherence to study the sample structure by coherent diffraction imaging (CDI). In this technique, the 3D electron density of the sample in real space is reconstructed by a phase retrieval algorithm from the scattered intensity distribution measured in whole reciprocal space (Shabalin et al., 2016;Carnis et al., 2021). This may be achieved by the angular scan of the sample with a large unit cell in small-angle X-ray scattering (SAXS) geometry as shown in Figs. 1(c)-1(e). Although such a reconstruction provides full information about the structure, the method is highly demanding in terms of experimental requirements and data quality. AXCCA is based on the analysis of angular correlations of scattered intensities in reciprocal space and can be applied to datasets of much lower quality, for which the phase retrieval algorithms fail, to reveal the structural features averaged over the sample without the need to perform a reconstruction (Schlotheuber né Brunner et al., 2021).
In this work, we propose employment of AXCCA to study symmetries of the intensity distribution in 3D reciprocal space from a single-crystalline sample. We apply this method to simulated datasets for model colloidal structures and propose a geometrical model to interpret the results. As an example of practical application, we employ the dataset collected for a CDI reconstruction of a colloidal crystal grain (Shabalin et al., 2016;Meijer et al., 2014). We show that the developed method provides qualitative information about the real space structure without performing a complex iterative phase retrieval.
2. Theory 2.1. AXCCA applied to the intensity distribution in 3D reciprocal space Here, we consider the scattered intensity distribution measured by a 2D detector. The conventional AXCCA is based on the analysis of a two-point cross-correlation function (CCF) defined as (Niozu et al., 2020) where Ĩ(q 1 ) and Ĩ(q 2 ) are the scattered intensities measured by the detector at the points corresponding to the momentum transfer vectors q 1 and q 2 with the relative angle Á between them. The averaging is performed over all positions corresponding to q 1 and q 2 with the lengths q 1 = ||q 1 || and q 2 = ||q 2 ||, respectively. The intensities can be scaled to their mean values, for example, asĨ where averaging is performed over all measured intensities corresponding to the momentum transfer vectors q i with a certain length q i = ||q i ||. When the measurements are performed in the SAXS geometry corresponding to small momentum transfer vectors, one can neglect the curvature of the Ewald sphere. Then, the definition in equation (1)   (a) Scheme of the experimental setup for measuring 2D diffraction patterns from different randomly oriented samples injected into the incident X-ray beam. The patterns collected represent random cuts of 3D reciprocal space as shown in (b). (c) Scheme of the experimental setup for measuring 2D diffraction patterns from a single sample rotated around an axis normal to the incident beam. (d) 2D patterns of known orientation can be further interpolated into 3D intensity distribution (e).
where Ĩ(q, ') is the scattered intensity measured by a detector at the position q = (q, '), here q, ' are the polar coordinates, and hÁ Á Ái ' denotes averaging over all angles of '. The variables used in the definition of CCF in equation (3) are shown in Fig. 2(a). Typically, the CCFs are averaged over many 2D diffraction patterns collected from different realizations of the system (at different positions of the sample, at different times or from different randomly oriented injected particles). Averaging over many different system realizations allows suppression of random correlations in the scattered intensities specific to a certain realization of the system. The averaged CCFs represent systematic correlations that correspond specifically to the internal structure of the samples and not to the certain realization of the system. Moreover, averaging over many orientations of the samples allows assessment of the correlations in different cuts of 3D reciprocal space. Thus, the resulting CCFs represent all correlations in 3D reciprocal space and not only in certain planes.
In this work, we propose to apply equation (1) to the scattered intensity distribution in 3D reciprocal space measured for a single sample. In 3D reciprocal space, both momentum transfer vectors q 1 and q 2 can take any angular position. The averaging in equation (1) is then performed over spheres in reciprocal space with the radii q 1 = ||q 1 || and q 2 = ||q 2 ||, respectively, as shown in Fig. 2(b). The resulting CCFs in this case contain all present correlations from a single sample without a need to perform averaging over many realizations.
We note that a similar result would originate from averaging over many randomly oriented 2D scattering patterns collected from the same sample (or identical samples). Indeed, each pair of momentum transfer vectors taken in 3D reciprocal space lay in a certain 2D hyperplane that can be thought of as a 2D diffraction pattern. If the number of the randomly oriented 2D patterns is big enough, they cover the whole 3D space and the CCFs averaged over such a set of 2D patterns are identical to the CCFs calculated for the 3D pattern (Niozu et al., 2020). The number of randomly oriented 2D scattering patterns required to obtain the same information as from the 3D scattered intensity distribution is discussed in Section 3.3.

CCFs in the case of a crystalline sample
AXCCA was shown to be useful to extract additional information from the scattering patterns of crystalline samples (Mendez et al., 2016;Niozu et al., 2020). In this case, the scattered intensity contains well defined Bragg peaks originating from the crystallographic planes of the sample. When the CCF C(q 1 , q 2 , Á) is calculated at the momentum transfer values q 1 and q 2 corresponding to the Bragg peak positions, it contains correlation peaks at the characteristic relative angles Á between the Bragg peaks, i.e. the reciprocal lattice vectors g 1 and g 2 with the lengths q 1 = ||g 1 || and q 2 = ||g 2 ||.
Given a model of a unit cell with the lattice basis vectors a 1 , a 2 and a 3 , we can calculate the reciprocal basis vectors b 1 , b 2 and b 3 and thus any reciprocal lattice vector (Kittel, 2004). For a pair of Bragg peaks corresponding to the reciprocal lattice vectors g 1 and g 2 , the angle between them can be calculated using the scalar product where dot indicates a scalar product between two vectors. These Bragg peaks would contribute to the CCF calculated for the momentum transfer values q 1 and q 2 corresponding to the norms of the vectors q 1 = ||g 1 || and q 2 = ||g 2 ||, respectively, at the angle Á, as shown in Fig. 3 Scheme of the CCF calculation in the case of 2D (a) and 3D (b) intensity distributions. The product of intensities at two points q 1 and q 2 in reciprocal space, separated by the angle Á, contribute into the CCF value at this Á value. The final CCF is obtained by averaging over all points on the rings/spheres of the corresponding radii. The color code exemplarily represents the simulated intensities for a colloidal crystal with an f.c.c. structure: (a) 2D diffraction pattern from the colloidal crystal oriented along the [001] f.c.c. axis with respect to the incident X-ray beam and (b) intensities at the spheres in 3D reciprocal space of the colloidal crystal with the radii q 1 and q 2 , corresponding to the 111 and 220 reflections, respectively.
contribute to the CCF at the same angle Á = arc cos (1/3) % 70.53 . In such a case, different peaks in the resulting CCFs can have different degeneracy, which is reflected in their relative magnitudes. Considering close-packed structures, different stacking motifs of hexagonal layers result in different symmetries of the structures. Two structures of high symmetry are f.c.c. and hexagonal close-packed (h.c.p.) lattices with the following stacking sequences: ABCABC for f.c.c. and ABAB for h.c.p. (Conway & Sloane, 2013). Stacking faults -irregularities in the stacking sequence -are very common defects in closepacked structures due to a low energy difference between the ideal structures (Bolhuis et al., 1997). A single inversion of the f.c.c. stacking sequence ABCABCBACBA corresponds to a AE 3 -twinning boundary and results in two twinned f.c.c. domains. Random stacking of hexagonal layers results in a socalled 'random h.c.p.' (r.h.c.p.) structure containing the motifs characteristic for both f.c.c. and h.c.p. structures. In reciprocal space, the stacking faults produce strong diffuse scattering in the stacking direction connecting the Bragg peaks in the form of rods known as Bragg rods, as shown in Fig. 3(b). Such Bragg rods are intensity modulations in reciprocal space along the straight lines connecting the Bragg peaks with fixed h and k indexes for which h À k 6 ¼ 3n; n 2 Z and any index l 2 R (in h.c.p. notation). The Bragg peaks with indexes h À k ¼ 3n; n 2 Z and l 2 Z are stacking-independent and are isolated in reciprocal space (Petukhov et al., 2003). The intensity profiles along the Bragg rods depend on the particular stacking sequence as described by Meijer et al. (2014). In contrast to the isolated Bragg peaks that contribute to the CCFs at certain q-values, the Bragg rods contribute to the CFFs in a continuous q-range. Their contribution can be evaluated using the scalar product and corresponding reciprocal basis vectors as described in Appendix A.

Results
We demonstrate application of the AXCCA technique on simulated and experimentally measured datasets. The simulated datasets represent scattered intensity distributions in 3D reciprocal space calculated for colloidal crystal grains of different structures. The experimentally measured dataset is the scattered intensity distribution from a similar colloidal crystal studied previously (Shabalin et al., 2016;Meijer et al., 2014). Each of the datasets initially consisted of 360 diffraction patterns obtained by rotation of the sample in the range 0-180 around the vertical axis with an angular step size of 0.5 . The simulation parameters selected were similar to those used in the experiment: X-ray energy E = 8 keV ( = 1.55 Å ), a 2D detector (512 Â 512 pixels) with the pixel size 55 Â 55 mm 2 positioned downstream from the sample at the distance d = 5.1 m. The experimental dataset was collected at the P10 Coherence Application beamline at PETRA III synchrotron using a MAXIPIX detector. The 2D patterns from each dataset were interpolated onto a 3D orthogonal grid with a voxel size of 0.4375 mm À1 . We used the flat Ewald sphere approximation because of small scattering angles (less than 0.25 , the corresponding q-values less than 200 mm À1 ).

Application to the simulated data
For simulations, we considered a spherical colloidal crystal grain with an outer size of 3.6 mm consisting of monodisperse silica spheres with a diameter of 230 nm. Different closepacked structures typical for colloidal crystals were simulated: ideal f.c.c. and h.c.p. lattices, two f.c.c. domains with a AE 3twinning boundary, as well as an r.h.c.p. lattice with the stacking sequence ABCABCBCBCACBCBABAB matching the one observed in the CDI reconstruction (Shabalin et al., 2016) of the experimental data discussed below. The nearestneighbour distance for all the structures was equal to the diameter of the constituting silica spheres (230 nm). The simulated structures consist of corresponding stacking motifs of the hexagonal layers, as shown in Figs. 4(a), 4(d), 4(g) and 4( j).
The 2D diffraction patterns from the structures were simulated using the MOLTRANS software. On the simulated diffraction patterns (see Fig. 4) one can observe concentric rings of intensity due to the form factor of the colloidal spheres and the Bragg peaks that originate from the structure factor of the colloidal crystal lattice. In the diffraction patterns for the structures with stacking faults [see Figs. 4(i) and 4(l)], aside from the isolated Bragg peaks, the Bragg rods along the q z direction that connect Bragg peaks can be clearly observed.
The azimuthally averaged intensities of the 3D scattered intensity distributions for these structures are shown in Fig. 5(a). The intensity profiles for the ideal f.c.c. and h.c.p. lattices are quite different as they contain the characteristic Bragg peaks for these structures. In contrast, the profile for two twinned f.c.c. domains with a AE 3 -boundary between them is almost identical to the one for the perfect f.c.c. lattice. This is an expected result because the major contribution to the scattered intensity originates from the domains with the same f.c.c. structure, whereas the contribution from the boundary is negligible. The radial profile for the r.h.c.p. structure is smoothed and contains mostly the peaks common for the f.c.c.  Models of 3D reciprocal space for (a) h.c.p. and (b) r.h.c.p. lattices. The black dot is the origin of reciprocal space, colored dots are the Bragg peaks. The semitransparent sphere shows the sphere S of the radius q = ||q 1 || = ||q 2 ||, at which the CCF is calculated. In (a) the green dots are the Bragg peaks intersecting the sphere S and, thus, contributing to the corresponding CCF at the angle Á. In (b), the orange rods represent the Bragg rods. They contribute to the corresponding CCF at the angle Á that is dependent on the radius q of the sphere S. and h.c.p. structures, making it hard to identify the exact stacking sequence. It is even harder in the case of the experimentally measured profile [shown in Fig. 5(a) for comparison] due to lower contrast.
We calculated the CCFs for the pairs of points with the same q-value q = ||q 1 || = ||q 2 || in the simulated 3D intensity distributions for all four different structures (see Appendix B for details of the calculation). We considered the CCFs for Simulation of 2D diffraction patterns from the structures: intensities at q = 55 mm À1 that correspond to stacking independent reflections present for all structures [see Fig. 5(a)]. This q-value corresponds to the 220 reflections from the f.c.c. structure and to the 110 reflections from the h.c.p. structure. Even though these reflections correspond to the same dspacing, the angles between the equivalent planes are different for these structures. Therefore, the peaks in the CCFs appear at different positions for different structures, as shown in Fig. 5(b). The peak positions from the geometrical model (see Appendix A) coincide with the peak positions in the calculated CCFs for the simulated structures as shown in Fig. 5(b). The peak positions for an f.c.c. structure are clearly distinct from those for an h.c.p. structure because of different symmetry. The CCF for the twinned f.c.c. structure contains additional peaks that are correlations between the peaks originating from different domains. The position of additional peaks is defined by the twinning transformation described in Appendix A. This approach can be extended to other types of twinning (e.g. AE 5 or AE 9 ). The CCF for the r.h.c.p. structure is similar to the one for the twinned f.c.c. domains, but the relative intensity of the peaks is different. This probably indicates the presence of both h.c.p. and f.c.c. stacking motifs, but more general conclusions can be made only analyzing the CCFs calculated for different q-values as described below.
Additional information can be accessed if we review a set of CCFs calculated for various q-values. We calculated the CCFs in the range q = 25-115 mm À1 with a step size of 1 mm À1 (see Fig. 6). As shown in this figure, the peaks for the simulated structures have different positions in both radial and angular directions, since they originate from different sets of equivalent planes defined by the lattice symmetry. The peak positions for these structures can be calculated from the geometrical model of the reciprocal lattice as described in Appendix A. We note that the peak positions were determined for the structures with the unit-cell parameters corresponding to the nearest neighbor distance of 230 nm (the size of the silica spheres). In an arbitrary experiment, the unit-cell parameters can be used as the fitting parameters to fit the peak positions in the experimental CCFs (Carnis et al., 2021;Schlotheuber né Brunner et al., 2021).
For the ideal f.c.c. and h.c.p. structures, the positions of all brightest peaks in the CCFs coincide with the positions obtained from the geometrical model [see Figs. 6(a) and 6(b)]. Additionally, there are low-intensity peaks at the q-values between the bright peaks that are not explained with this model [see, for example, additional peaks at q = 36 mm À1 in Fig. 6(a)]. They originate from the correlations between the Bragg peaks of different orders. Basically, different orders contribute to the scattered intensities at different q-values, but due to the broadening of the Bragg peaks and the absence of noise in the simulated data, their tails contribute to the CCFs. These are not observed in the experimental data due to noise and other artifacts, but can also be considered in the simple geometrical model.
For the twinned f.c.c. structure, the map contains many additional peaks that reflect correlations between the Bragg peaks that originate from different domains. As discussed above, the peak positions are defined by the twinning transformation and can be taken into account as described in Appendix A. For the r.h.c.p. structure, the map contains peaks characteristic for both h.c.p. and f.c.c. structures. It is rather an expected result as soon as the r.h.c.p. structure contains stacking sequences that can be attributed to both h.c.p. and f.c.c. structures. Besides the isolated peaks, the CCFs for the r.h.c.p. and twinned-f.c.c. structures contain also intensity in the form of 'arcs' connecting the peaks. They originate from the Bragg rods characteristic for stacking disordered structures with planar defects. Their contribution to the CCFs can be calculated following the procedure described in Appendix A and shown in Fig. 6(d).   (1) f.c.c. (2) h.c.p.
(3) twinned f.c.c. domains and (4) r.h.c.p. and from the experimentally measured sample (5), for comparison. The vertical red dashed line is at q = 55 mm À1 corresponding to 220 f.c.c. / Despite similar intensity profiles, different structures result in different angular distribution of the Bragg peaks. The AXCCA technique allows us to reveal the angular correlations between the Bragg peaks and to determine qualitatively the sample structure even when the azimuthally integrated intensity profiles are almost identical.

Application to the experimental data
The experimentally measured sample was a colloidal crystal grain with an outer size of about 2 Â 3 Â 4 mm 3 consisting of silica spheres with a diameter of about 230 nm prepared as described by Shabalin et al. (2016) and Meijer et al. (2014). The collected scattered intensity distribution in 3D reciprocal space contains several orders of Bragg peaks and Bragg rods [see Fig. 7(a)]. An in-plane cut through the origin of reciprocal space [see Fig. 7(b)] reveals the sixfold symmetry characteristic for hexagonal layers of close-packed nanoparticles. Two out-of-plane cuts shown in Figs. 7(c) and 7(d) contain the Bragg rods connecting the Bragg peaks indicating the stacking disorder of the nanoparticle layers. Note that the experimentally measured diffraction patterns have significantly lower contrast compared with the simulated ones. This can be attributed to the polydispersity of the colloidal particles, the partial coherence of the incident X-rays and other experimental artifacts that are not taken into account in the simulations.
The experimental CCFs calculated in the range q = 25-115 mm À1 with a step size of 1 mm À1 are shown in Fig. 8(a). Owing to the lower contrast of the diffraction patterns, these correlation maps also have lower contrast compared with the simulated ones. Moreover, the measured intensity in the locations of form factor minima does not contain any structural information leading to the absence of peaks in the CCFs at the corresponding q-values (e.g. at q = 38 mm À1 ). We assumed the colloidal crystal has a close-packed structure and calculated the peak positions in the CCFs according to the geometrical model for the same structures as for the simulated data: ideal f.c.c., h.c.p. and twinned f.c.c. Also, we calculated the positions of the 'arcs' corresponding to the correlations between the Bragg rods. The experimental CCFs with the indicated peak positions are shown in Figs. 8(b)-8(d).
Most of the peaks present in the experimental CCFs have the peak positions characteristic for an h.c.p. structure [see Fig. 8(c)], indicating that this stacking motif is a predominant one. Several peaks do not match the positions for the h.c.p. structure, but their positions are characteristic of an f.c.c. structure [see Fig. 8  stacking motif in the sample as well. The peaks characteristic for twinned f.c.c. domains are not present in the experimental CCFs [compare with Fig. 6(c)], indicating the absence of such motifs in the sample. In addition, there are 'arcs' characteristic for correlations between the Bragg rods similar to those for the simulated r.h.c.p. structure.
Indeed, the stacking sequence revealed in the reconstructed real space structure is ABCABCBCBCACBCBABAB (Shabalin et al., 2016). This sequence, in general, can be described as a random h.c.p. structure with many stacking faults. However, we can distinguish h.c.p. and f.c.c. motifs in the sequence that produces the corresponding peaks in the CCFs.
3.3. Comparison of AXCCA applied to the intensity distribution in 3D reciprocal space and with the randomly oriented 2D diffraction patterns As mentioned in Section 2.1, the CCFs calculated for the intensity distribution in 3D reciprocal space should be similar to the many averaged 2D diffraction patterns obtained from different random angular orientations of the same sample. Such a dataset of 2D diffraction patterns could be collected in an XFEL experiment performed in the single-particle imaging (SPI) experiment, if the same crystalline structure was injected into the X-ray beam many times with random orientations. To prove the similarity of the CCFs obtained from the 3D intensity distribution and the averaged 2D diffraction patterns in random orientations, we simulated 5 Â 10 4 diffraction patterns from the randomly oriented colloidal crystal with the f.c.c. structure using the MOLTRANS software as described in Section 3.1. The angular orientations were uniformly distributed in 3D. The CCFs were calculated for q-values in the range q = 25-115 mm À1 using equation (3) for each diffraction pattern separately and then averaged over all patterns.
The resulting CCFs averaged over all 5 Â 10 4 patterns are shown in Fig. 9(b) and can be compared to those calculated for the intensity distribution in 3D reciprocal space as described in Section 3.1 and shown in Fig. 9(a). As we can see from these figures, the CCF maps are almost identical and contain peaks   at the same positions. Small deviations probably originate from interpolation of the scattered intensities onto the 3D grid in the second case.
In contrast, the CCF maps averaged over 5 Â 10 2 2D patterns, shown in Fig. 9(c), contain only a fraction of the peaks present in the CCF map calculated for the 3D intensity distribution. This is because such a small number of patterns does not fully cover all possible orientations. Indeed, to contribute to the CCF, a pair of Bragg peaks should be present in a single 2D diffraction pattern. Thus, it requires a certain number of randomly oriented diffraction patterns to catch all possible pairs of the Bragg peaks.
To estimate the number of 2D diffraction patterns in random orientations required to obtain a CCF map similar to the one calculated from the 3D scattered intensity distribution, we calculated the Pearson correlation coefficient (Kendall & Stuart, 1973) r(N) between the CCF maps averaged over different numbers of 2D patterns and the one from the 3D intensity distribution defined as where C 3D (q, Á) are the CCFs calculated for the intensity distribution in 3D reciprocal space, and C N (q, Á) are the CCFs calculated for the randomly oriented 2D diffraction patterns and averaged over N patterns. The averaging was performed over all q-values in the range q = 25-115 mm À1 and angles Á = 0-180 for which the CCFs were calculated. We note that the calculated CCFs have zero mean value with averaging over angle Á at the fixed q-value that allows direct application of the Pearson correlation coefficient. The evolution of the correlation coefficient with the number of diffraction patterns is shown in Fig. 9(d). When the number of patterns used is below 10 2 , the correlation coefficient is close to zero, indicating that the CCFs do not contain any features corresponding to the structural information. With further increase in the number of patterns used, the correlation coefficient grows indicating the successive appearance of the structured features in the CCF map. At about 3 Â 10 3 patterns it reaches a plateau, while with further increase in the number of patterns it grows only a little bit to the value of 0.95 for 5 Â 10 4 patterns. We suggest that all features in the CCF map appear already at 3 Â 10 3 patterns, while further increase in the number of patterns leads to only minor changes in the relative intensities of the correlation peaks.
Thus, the CCFs calculated from the 2D diffraction patterns obtained for different random orientations of the sample are similar to the CCFs calculated from the scattered intensity distribution in 3D reciprocal space measured for the sample, when the number of 2D patterns is high enough. In the particular case under consideration, the number of required 2D correlation maps C(q, Á) for the experimentally measured intensity distribution in 3D reciprocal space. (a) Initial correlation map. The markers in (b)-(c) indicate the peak positions for (b) f.c.c. and (c) h.c.p. structures calculated from the geometrical model. In (d) the dashed lines indicate the correlations between the Bragg rods simulated for the r.h.c.p. structure. Only correlations within 10l (black lines), 20l (red lines) and 21l (blue lines) Bragg rod families are shown. Correlations between the Bragg rods from different families as well as for higher order families have been omitted for clarity. randomly oriented 2D diffraction patterns is about two orders of magnitude higher than the number of systematically measured 2D patterns (e.g. by rotation of the sample) required for reconstruction of the intensity distribution in 3D reciprocal space.
Note that the number of randomly oriented 2D diffraction patterns required to obtain the CCF map similar to the one calculated from the 3D intensity distribution is individual for each sample under study. The number of required patterns depends on the probability to catch at least a pair of the Bragg peaks into a single 2D pattern that, in turn, depends on the angular size and separation of the Bragg peaks in 3D reciprocal space. Therefore, for bulk crystals with many scatterers and small periodicity, the required number of 2D patterns may be sufficiently higher.
The important point here is the distribution of the angular orientations of the sample, for which 2D diffraction patterns are obtained. Only uniform angular distribution allows us to obtain CCFs similar to those from the 3D intensity distribution, because the 2D patterns in this case cover all pairs of the points in reciprocal space with equal probability. If the angular distribution is not uniform, some correlations will be enhanced while others will be weakened.
To show this, we simulated 2D diffraction patterns from a colloidal crystal with the f.c.c. structure using the MOLTRANS software. We simulated two datasets, obtained 2D correlation maps C(q, Á) calculated for (a) the simulated scattered intensities in 3D reciprocal space and (b)-(e) 2D diffraction patterns from a randomly oriented sample averaged over (b) 5 Â 10 4 and (c) 5 Â 10 2 patterns. The scattered intensity distribution in 3D reciprocal space and the 2D diffraction patterns were simulated for the same colloidal crystal with an f.c.c. structure. (d) Pearson correlation coefficient r(N) between the CCF maps averaged over different numbers of 2D diffraction patterns and the CCF map calculated for the intensity distribution in 3D reciprocal space for the same sample. (e)-( f ) 2D correlation maps C(q, Á) calculated for 2D diffraction patterns obtained by rotation of the sample with an f.c.c. structure around the (e) [111] f.c.c. and [110] f.c.c. axes in the range 0-180 with an angular step size of 0.5 . The CCFs were calculated for the 2D diffraction patterns in the qrange 25-115 mm À1 with the step size of 1 mm À1 and then averaged over all angular positions of the sample. The resulting CCFs calculated for these two datasets are shown in Figs. 9(e) and 9(f ). They are different from each other and from the CCF map obtained for the 3D intensity distribution shown in Fig. 9(a). The difference can be explained as follows. A pair of the Bragg peaks gives rise to a peak in the CCFs only if both Bragg peaks are present in the same 2D diffraction pattern. When the diffraction patterns are collected by rotation of the sample around one of its crystallographic axes, each diffraction pattern contains different pairs of the Bragg peaks. The exact set of the Bragg peak pairs present in the dataset is defined by the selected crystallographic axis. Thus, the datasets collected by rotation around different crystallographic axes contain different pairs of the Bragg peaks that give rise to the peaks in the CCF maps. The present peaks in the CCF maps in this case have higher intensity compared with those in the CCF maps obtained for the randomly distributed 2D patterns. This is because, in the latter case, the CCFs are averaged over many patterns, most of which do not contain any correlations at a certain q-value. The diffraction patterns obtained by the rotation around one crystallographic axis are an extreme case, but any other distribution with a preferred direction would result in similar deviations.

Conclusions
We proposed to apply the AXCCA technique to the scattered intensity distribution in 3D reciprocal space. Here, we demonstrated an application of the AXCCA for qualitative determination of the crystalline structure of a colloidal crystal, including the present planar defects. AXCCA provides a complementary view on the structure when CDI reconstruction does not work (Schlotheuber né Brunner et al., 2021). The results can be interpreted by means of a simple geometrical model of the crystalline lattice and defects. Direct sensitivity to the angles in reciprocal space provides additional information about the structure compared with the conventional radial intensity profile analysis.
The application of AXCCA to the 3D scattered intensity distribution measured from a single sample by its rotation made it possible to avoid averaging of the revealed structure over many realizations with possibly different defects present. Moreover, the systematic measurement allowed us to significantly reduce the number of measurements needed to obtain orientationally averaged CCFs, compared with measurements from random orientations. We also showed that averaging over 2D diffraction patterns measured during rotation around the fixed axis does not provide the same CCFs as the assembly of intensity distributions in 3D reciprocal space. We think that it is an essential part of the proposed method.
The method described here works well for the colloidal samples with the large unit cell. For such samples, a single rotation around one axis is sufficient to collect scattered intensities in whole reciprocal space. The same method can be applied as well for the crystal grains with the unit cell of a few Å ngstroms. In this case, due to the Ewald sphere curvature, one will need to apply two rotations around two orthogonal axes to cover full reciprocal space of the crystal grain. The described formalism will be applicable also in this case.
This approach was already successfully applied for the analysis of the averaged structures and defects in single colloidal grains of gold and magnetite nanocrystals (Carnis et al., 2021;Schlotheuber né Brunner et al., 2021). We expect that it will find applications for understanding the structure of colloidal grains and single crystals in future.

APPENDIX A Geometrical interpretation of the CCFs
Here, we follow the discussion provided by Niozu et al. (2020) and apply it to our structures. Any reciprocal lattice vector can be represented as a linear combination of the basis vectors g hkl ¼ hb 1 þ kb 2 þ lb 3 . Let us denote a family of equivalent crystallographic directions as G hkl . Each crystallographic direction that fulfills the diffraction selection rules for a given lattice symmetry corresponds to the position of a Bragg peak in reciprocal space. Using the coordinates of the reciprocal lattice vectors g hkl and g h 0 k 0 l 0 we can calculate the angle Á between a certain pair of the Bragg peaks corresponding to these vectors. This Bragg peaks pair would contribute at the angle Á to the CCF C(q 1 , q 2 , Á) calculated for q 1 = ||g hkl || and q 2 = ||g h 0 k 0 l 0 ||. To evaluate all contributions for a certain fixed q 1 and q 2 , we should consider all Bragg peaks that appear in reciprocal space at these q-values. Then, all angles Á can be calculated using the scalar product if one considers all possible pairs of the vectors g hkl and g h 0 k 0 l 0 from certain families of equivalent crystallographic directions G hkl and G h 0 k 0 l 0 , respectively, corresponding to the q-values q 1 and q 2 . Note, in some cases, several families G h i k i l i may contribute at the same q-value. Then, an extended set of the vectors [ i G h i k i l i should be considered. Several crystalline domains in the sample would result in two types of correlation: intra-domain correlations between the Bragg peaks originating from a single domain and interdomain correlations between the Bragg peaks originating from different domains. The intra-domain correlation contribution to the CCFs can be evaluated as described above. To evaluate the contribution of the inter-domain correlations, one should consider the relative orientation of the domains. The orientation can be taken into account by introducing an orthogonal transformation matrix T that transforms the basis vectors of one domain into the basis vectors of another. Then, the inter-domain correlations contribute to the CCF C(q 1 , q 2 , Á) at the angles Á that can be found using the scalar product if one considers all possible pairs of the vectors g hkl and g h 0 k 0 l 0 from certain families of equivalent crystallographic directions G hkl and G h 0 k 0 l 0 corresponding to the q-values q 1 and q 2 .
For example, for f.c.c. and h.c.p. lattices discussed in this paper, the reciprocal basis vectors can be defined as follows:  For the simplest f.c.c. twinning with a AE 3 -boundary discussed in this paper, the transformation matrix T corresponds to a reflection of the f.c.c. lattice across the (111) f.c.c. plane and can be written in the following form: The Bragg rods originating from the stacking disorder of the hexagonal layers in close-packed structures are intensity modulations along the straight lines normal to the hexagonal layers and along the stacking direction. Their positions are defined by the reciprocal lattice and, using the h.c.p. reciprocal basis vectors from equation (8), can be described by g hk ðlÞ ¼ g hk0 þ g ? ðlÞ, where g hk0 is a vector from a certain inplane Bragg peaks family G h:c:p: hk0 and g ? ðlÞ ¼ lb h:c:p: 3 ; l 2 ðÀ1; 1Þ is a vector along the Bragg rod, normal to the planes. Note the Bragg rods are present only for stacking-dependent families G h:c:p: hk0 for which h À k 6 ¼ 3n; n 2 Z (Petukhov et al., 2003).
The parameter l corresponding to a certain q-value can be easily calculated for any Bragg rod corresponding to a certain in-plane reciprocal lattice vector g hk0 as Then, a pair of Bragg rods, corresponding to different in-plane vectors g hk0 and g h 0 k 0 0 contributes to the CCF C(q 1 , q 2 , Á) at the angle Á that can be calculated using the scalar product g hk ðl 1 Þ Á g h 0 k 0 ðl 2 Þ ¼ kg hk ðl 1 Þkkg h 0 k 0 ðl 2 Þk cosðÁÞ; where g hk ðl i Þ ¼ g hk0 þ g ? ðl i Þ, g hk0 is a vector of a certain family G h:c:p: hk0 , g ? ðl i Þ ¼ l i b h:c:p: 3 and parameter l i corresponding to the q-value q i is defined by equation (10).

APPENDIX B Definition of the cross-correlation function for the intensities defined on a grid
Taking into account that the experimental data are typically defined on a grid in reciprocal space, equation (2) can be represented as where G ¼ fjkq i kÀq 1 j<"g \ fjkq j kÀq 2 j<"g \ fjÁ ij À Áj<dÁg; q i and q j are the points close to the spheres of the radii q 1 , q 2 in reciprocal space, respectively; Á ij is the relative angle between these points. Parameters " and dÁ define the radial and angular averaging windows, respectively. The sum is calculated over all pairs of points q i , q j with the corresponding relative angle Á. The average intensity used for the intensity correction in this case is Given the desired resolution of 1 mm À1 , in this work the radial averaging window " was selected to be 0.5 mm À1 . The angular resolution of Á was experimentally set to 0.5 that allows us to resolve all peaks in the resulting CCFs. The angular averaging window dÁ was correspondingly set to 0.25 .